﻿using System;
using System.Collections.Generic;

namespace BSharp.Compiler
{
	public class FunctionDeclaration : AstNode
	{
		public readonly string Name;
		public readonly List<string> Parameters = new List<string> ();
		public readonly AstNode Body;

		public FunctionDeclaration (SourceLocation location, string name, AstNode body)
			: base (location)
		{
			Name = name;
			Body = body;
		}

		public override void Visit (AstVisitor visitor)
		{
			visitor.Accept (this);
		}

		public override void VisitChildren (AstVisitor visitor)
		{
			Body.Visit (visitor);
		}
	}
}

